const thunk = ({getState, dispatch}) => dispatch => action => {
    if(typeof action === 'function'){
        return action(dispatch, getState);
    }
    return dispatch(action);
};

export default thunk;